<?php
// $Id$

/**
 * Controller_Admin_Newsconfig 控制器
 */
class Controller_Admin_Newsconfig extends Controller_Abstract
{
	
	function actionIndex()
	{
       $this->union_table = Newsconfig::meta();
       $this->lists();
	}
	function actionadd()
	{
		$this->union_table = Newsconfig::meta();
		
		$handle = new helper_autoinsert($this->union_table);
		$form = new Form_newsConfig_add(url($this->_context->controller_name.'/'.$this->_context->action_name));
		$result = $handle->add($form, 'id',$_GET);
		
		if ($this->_context->isGET())
		{
			$this->_view['form'] = $result;
			$this->_viewname = '../form/add';
		}else {
			Syslog::logs('添加公告');
			return call_user_func_array(array($this,$handle->status),array($result));
		}
	}
	function actiondel()
	{
		Syslog::logs('删除公告:'.$this->_context->ids);
		$this->union_table = Newsconfig::meta();
		$this->delete(array('id'=>$this->_context->ids));
	}
	
}


